Spring: Developing Java Applications for the Enterprise by Soni Ravi Kant & Ganeshan Amuthan & RV Rajesh

Spring: Developing Java Applications for the Enterprise by Soni Ravi Kant & Ganeshan Amuthan & RV Rajesh

Author:Soni, Ravi Kant & Ganeshan, Amuthan & RV, Rajesh [Soni, Ravi Kant]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2017-02-28T05:00:00+00:00


Create an interface named OrderService under the com.packt.webstore.service package in the src/main/java source folder and add the following method declarations to it as follows: package com.packt.webstore.service; import com.packt.webstore.domain.Order; public interface OrderService { Long saveOrder(Order order); }

Create an implementation class named OrderServiceImpl for the previous interface under the com.packt.webstore.service.impl package in the src/main/java source folder and add the following code to it: package com.packt.webstore.service.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.packt.webstore.domain.Order; import com.packt.webstore.domain.repository.OrderRepository; import com.packt.webstore.service.OrderService; @Service public class OrderServiceImpl implements OrderService{ @Autowired private OrderRepository orderRepository; @Override public Long saveOrder(Order order) { return orderRepository.saveOrder(order); } }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.